package mi.payment.utils.iso8583;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2016/6/20.
 */
public class TransInfo {
    private static final Map transtypes = new HashMap<String, String>();

    public static String getName(String code) {
        if(transtypes.isEmpty()) {
            initMap();
        }

        if(transtypes.containsKey(code)) {
            return (String) transtypes.get(code);
        } else {
            return code;
        }
    }

    private static void initMap() {
        transtypes.put("00", "管理类交易");
        transtypes.put("01", "查询");
        transtypes.put("03", "积分查询");
        transtypes.put("10", "预授权");
        transtypes.put("11", "预授权撤销");
        transtypes.put("20", "预授权完成");
        transtypes.put("21", "预授权完成撤销");
        transtypes.put("22", "消费(SALE)");
        transtypes.put("23", "消费撤销");
        transtypes.put("24", "预授权完成");
        transtypes.put("25", "退货");
        transtypes.put("27", "IC卡脱机交易退货");
        transtypes.put("30", "离线结算");
        transtypes.put("32", "结算调整");
        transtypes.put("34", "结算调整");
        transtypes.put("36", "脱机消费");
        transtypes.put("40", "电子钱包的IC卡指定账户圈存");
        transtypes.put("41", "电子钱包的IC卡现金充值");
        transtypes.put("42", "电子钱包的IC卡非指定账户转账圈存");
        transtypes.put("45", "电子现金指定账户圈存");
        transtypes.put("46", "电子现金现金充值");
        transtypes.put("47", "电子现金非指定账户转账圈存");
        transtypes.put("48", "磁条卡现金充值");
        transtypes.put("49", "磁条卡账户充值");
        transtypes.put("51", "电子现金现金充值撤销");
        transtypes.put("53", "预约消费撤销");
        transtypes.put("54", "预约消费");
    }
}
